prepare("select * from grain where productcode = $pcode" ) ; $getproduct->execute() ; while($row = $getproduct->fetch(pdo::FETCH_ASSOC) ) { if($row['measure'] == 'FULL CARTON') $fc = $row['amount'] ; if($row['measure'] == 'HALF CARTON') $hfc = $row['amount'] ; if($row['measure'] == 'ROLL') $fk = $row['amount'] ; //if($row['measure'] == 'HALF KILO') $hfk = $row['amount'] ; if($row['measure'] == 'PIECES') $pcs = $row['amount'] ; //if($row['measure'] == 'Litre') $perliterx = $row['amount'] ; } //get product name $getproductn = $DB_con->prepare("select * from products where product_code = $pcode" ) ; $getproductn->execute() ; $rown = $getproductn->fetch(pdo::FETCH_ASSOC) ; $product = $rown['product_name'] ; $price = $rown['price'] ; //get details of the admin $st = $_SESSION['st'] ; $ctry = $_SESSION['ctry'] ; $city = $_SESSION['city'] ; if(!$_SESSION['rs'] ) { $rs = 'nill' ; } else { $rs = $_SESSION['rs'] ; } if(isset($_POST['submit'])) { if($getproduct->rowcount() > 0) { $icode = $pcode ; $pieces = $_POST['pieces']; $carton = $_POST['carton']; $halfcarton = $_POST['halfcarton']; $kilo = $_POST['kilo']; $halfkilo = $_POST['halfkilo']; //$cup = $_POST['cup']; $mb = 'FULL CARTON' ; $mp = 'PIECES' ; $mhc = 'HALF CARTON' ; $mk = 'ROLL' ; //$mhk = 'HALF KILO' ; //$mc = 'Cup' ; //$ml = 'Liter' ; $stmt = $DB_con->prepare("update grain set amount = :c where (productcode =:a and measure =:b)") ; $stmt->bindparam(":a", $icode) ; $stmt->bindparam(":b", $mb) ; $stmt->bindparam(":c", $carton) ; $stmt->execute() ; $stmt1 = $DB_con->prepare("update grain set amount = :c where (productcode =:a and measure =:b)") ; $stmt1->bindparam(":a", $icode) ; $stmt1->bindparam(":b", $mhc) ; $stmt1->bindparam(":c", $halfcarton) ; $stmt1->execute() ; $stmt2 = $DB_con->prepare("update grain set amount = :c where (productcode =:a and measure =:b)") ; $stmt2->bindparam(":a", $icode) ; $stmt2->bindparam(":b", $mp) ; $stmt2->bindparam(":c", $pieces) ; $stmt2->execute() ; $stmt3 = $DB_con->prepare("update grain set amount = :c where (productcode =:a and measure =:b)") ; $stmt3->bindparam(":a", $icode) ; $stmt3->bindparam(":b", $mk) ; $stmt3->bindparam(":c", $kilo) ; $stmt3->execute() ; header("location: home.php") ; } else { $icode = $pcode ; $pieces = $_POST['pieces']; $carton = $_POST['carton']; $halfcarton = $_POST['halfcarton']; $kilo = $_POST['kilo']; $halfkilo = $_POST['halfkilo']; //$cup = $_POST['cup']; $mb = 'FULL CARTON' ; $mp = 'PIECES' ; $mhc = 'HALF CARTON' ; $mk = 'ROLL' ; //variebles end $stmt = $DB_con->prepare("insert into grain (measure,productcode,amount) values(:a,:b,:c)" ) ; $stmt->bindparam(":a", $mp) ; $stmt->bindparam(":b", $icode) ; $stmt->bindparam(":c", $pieces) ; $stmt->execute() ; $stmt2 = $DB_con->prepare("insert into grain (measure,productcode,amount) values(:a,:b,:c)" ) ; $stmt2->bindparam(":a", $mb) ; $stmt2->bindparam(":b", $icode) ; $stmt2->bindparam(":c", $carton) ; $stmt2->execute() ; $stmt3 = $DB_con->prepare("insert into grain (measure,productcode,amount) values(:a,:b,:c)" ) ; $stmt3->bindparam(":a", $mhc) ; $stmt3->bindparam(":b", $icode) ; $stmt3->bindparam(":c", $halfcarton) ; $stmt3->execute() ; $stmt4 = $DB_con->prepare("insert into grain (measure,productcode,amount) values(:a,:b,:c)" ) ; $stmt4->bindparam(":a", $mk) ; $stmt4->bindparam(":b", $icode) ; $stmt4->bindparam(":c", $kilo) ; $stmt4->execute() ; header("location: home.php") ; } } ?> Update

..Price Per Piece :